return {
  -- {
  --   "rcarriga/nvim-dap-ui",
  --   -- debugger
  --   --
  --   -- 末行模式运行 RustDebuggables  依赖 rust-tools 这里没有用到, 所以不用 "simrat39/rust-tools.nvim",  --
  --   -- 打断点      DapToggleBreakpoint
  --   -- 一行一行执行 DapStepOver
  --   -- 系统再安装  lldb
  --   dependencies = { "mfussenegger/nvim-dap" },
  --   config = function()
  --     -- local widgets = require('dap.ui.widgets');
  --     -- local sidebar = widgets.sidebar(widgets.scopes);
  --     -- sidebar.open();
  --     require("dapui").setup()

  --     local keymap = vim.keymap

  --     -- rust 断点
  --     keymap.set('', "<leader>db", ":DapToggleBreakpoint<CR>", { desc = "Toggle breakpoint" })
  --     keymap.set('', "<leader>dnn", ":RustDebuggables<CR>", { desc = "Rust Debuggables" })
  --     keymap.set('', "<leader>dsn", ":DapStepOver<CR>", { desc = "Step over" })
  --     keymap.set('', "<leader>dus", function()
  --       local widgets = require("dap.ui.widgets")
  --       local sidebar = widgets.sidebar(widgets.scopes)
  --       sidebar.open()
  --     end, { desc = "Open debugging sidebar" })
  --   end
  -- },
  -- {
  --   event = "BufReadPost",
  --   "mfussenegger/nvim-dap",
  --   dependencies = {
  --     -- 系统安装 lldb 工具
  --     --
  --     -- debugger
  --     --
  --     -- 末行模式运行 RustDebuggables  依赖 rust-tools 这里没有用到, 所以不用 "simrat39/rust-tools.nvim",
  --     -- 打断点  DapToggleBreakpoint
  --     -- 一行一行执行 DapStepOver
  --     --
  --     "rcarriga/nvim-dap-ui",
  --     -- 变量信息变化所见即所得 -- 不是必须的
  --     "theHamsta/nvim-dap-virtual-text",

  --     -- 好看ui提示 -- 不是必须的
  --     "nvim-telescope/telescope-dap.nvim",
  --   },
  --   config = function()
  --     local dap = require('dap')

  --     require("nvim-dap-virtual-text").setup {
  --       enabled = true,                     -- enable this plugin (the default)
  --       enabled_commands = true,            -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
  --       highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
  --       highlight_new_as_changed = false,   -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
  --       show_stop_reason = true,            -- show stop reason when stopped for exceptions
  --       commented = false,                  -- prefix virtual text with comment string
  --       only_first_definition = true,       -- only show virtual text at first definition (if there are multiple)
  --       all_references = false,             -- show virtual text on all all references of the variable (not only definitions)
  --       clear_on_continue = false,          -- clear virtual text on "continue" (might cause flickering when stepping)
  --       --- A callback that determines how a variable is displayed or whether it should be omitted
  --       --- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
  --       --- @param buf number
  --       --- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
  --       --- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
  --       --- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
  --       --- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
  --       display_callback = function(variable, buf, stackframe, node, options)
  --         if options.virt_text_pos == 'inline' then
  --           return ' = ' .. variable.value
  --         else
  --           return variable.name .. ' = ' .. variable.value
  --         end
  --       end,
  --       -- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line
  --       virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol',

  --       -- experimental features:
  --       all_frames = false,     -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
  --       virt_lines = false,     -- show virtual lines instead of virtual text (will flicker!)
  --       virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) ,
  --       -- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()`
  --     }

  --     -- ================================= python 断点配置 =============================
  --     dap.adapters.python = {
  --       type = "executable",
  --       command = '/usr/bin/python3',
  --       args = { '-m', 'debugpy.adapter' }, -- 需要安装 pip install debugpy
  --       -- 这里的name对应下面configurations中的type
  --       name = "python"
  --     }
  --     dap.configurations.python = {
  --       {
  --         type = 'python',
  --         request = 'launch',
  --         name = 'python launch file',
  --         -- 此处指向当前文件
  --         program = '${file}',
  --         args = function()
  --           -- 获取输入命令行参数
  --           local cmd_args = vim.fn.input('CommandLine Args:')
  --           local params = {}
  --           -- 定义分隔符(%s在lua内表示任何空白符号)
  --           -- local sep = "%s"
  --           for param in string.gmatch(cmd_args, "[^%s]+") do
  --             table.insert(params, param)
  --           end
  --           return params
  --         end,
  --         pythonpath = function()
  --           return '/usr/bin/python3'
  --         end,
  --       },
  --     }
  --     -- ================================= python 断点配置 =============================


  --     -- ================================= rust 断点配置 =============================
  --     dap.adapters.lldbrust = {
  --       type = "executable",
  --       attach = { pidProperty = "pid", pidSelect = "ask" },
  --       -- 这里指向lldb-vscode的实际路径
  --       -- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
  --       -- 参考 https://zhuanlan.zhihu.com/p/590908735
  --       -- lldb-vscode lldb-server 提前编译好的路径
  --       command = "/usr/bin/lldb-vscode",
  --       env = { LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY = "YES" },
  --       -- 这里的name对应下面configurations中的type
  --       name = "rust"
  --     }
  --     dap.adapters.rust = dap.adapters.lldbrust
  --     -- -- codelldb debug 配置
  --     -- -- cpp, c debug配置
  --     -- require('users.dap-configs.dap-codelldb.cfg')
  --     -- -- python debug配置
  --     -- require('users.dap-configs.dap-python.cfg')
  --     -- -- go debug 配置
  --     -- require('users.dap-configs.dap-go.cfg')
  --     -- -- rust debug 配置
  --     -- -- 也可以使用rust-tools下RustDebugee命令触发
  --     -- require('users.dap-configs.dap-rust.cfg')

  --     dap.configurations.rust = {
  --       {
  --         type = "rust",
  --         request = "launch",
  --         name = "lldb rust launch file",
  --         program = function()
  --           local metadata_json = vim.fn.system "cargo metadata --format-version 1 --no-deps"
  --           local metadata = vim.fn.json_decode(metadata_json)
  --           local target_name = metadata.packages[1].targets[1].name
  --           local target_dir = metadata.target_directory
  --           -- 获取程序打包后的文件, 注意先 cargo run 运行打包一下,否这找不到
  --           -- vim.notify(target_dir .. "/debug/" .. target_name, vim.log.levels.INFO, {})
  --           return target_dir .. "/debug/" .. target_name
  --         end,
  --         args = function()
  --           -- 同样的进行命令行参数指定
  --           local inputstr = vim.fn.input("CommandLine Args:", "")
  --           local params = {}
  --           for param in string.gmatch(inputstr, "[^%s]+") do
  --             table.insert(params, param)
  --           end
  --           return params
  --         end,
  --       },
  --     }
  --     -- ================================= rust 断点配置 =============================


  --     -- ================================ 断点快捷键配置 =========================
  --     local keymap = vim.keymap

  --     -- 断点快捷键设置
  --     -- https://github.com/mfussenegger/nvim-dap/tree/56118cee6af15cb9ddba9d080880949d8eeb0c9f
  --     -- -- 下一步
  --     -- keymap.set('n', '<F5>', function() require('dap').continue() end)
  --     -- -- 单步
  --     -- keymap.set('n', '<F10>', function() require('dap').step_over() end)
  --     -- -- 进入
  --     -- keymap.set('n', '<F11>', function() require('dap').step_into() end)
  --     -- keymap.set('n', '<F12>', function() require('dap').step_out() end)

  --     -- 下一步
  --     -- keymap.set('n', 'dc', function() require('dap').continue() end)
  --     -- telescope 替换 require('dap').continue() 好看一些
  --     keymap.set('n', 'dc', function() require('telescope').extensions.dap.configurations {} end)
  --     -- require('telescope').extensions.dap.configurations {}
  --     -- require('telescope').extensions.dap.commands {}
  --     -- require('telescope').extensions.dap.list_breakpoints {}
  --     -- require('telescope').extensions.dap.variables {}
  --     -- require('telescope').extensions.dap.frames {}

  --     -- 单步
  --     keymap.set('n', 'dr', function() require('dap').step_over() end)
  --     -- 进入
  --     keymap.set('n', 'di', function() require('dap').step_into() end)
  --     keymap.set('n', 'dt', function() require('dap').step_out() end)
  --     -- 设置断点
  --     keymap.set('n', '<Leader>db', function() require('dap').toggle_breakpoint() end)
  --     keymap.set('n', '<Leader>DB', function() require('dap').set_breakpoint() end)
  --     keymap.set('n', '<Leader>lp', function()
  --       require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: '))
  --     end)
  --     keymap.set('n', '<Leader>do', function() require('dap').repl.open() end)
  --     keymap.set('n', '<Leader>dl', function() require('dap').run_last() end)
  --     keymap.set({ 'n', 'v' }, '<Leader>dh', function()
  --       require('dap.ui.widgets').hover()
  --     end)
  --     keymap.set({ 'n', 'v' }, '<Leader>dp', function()
  --       require('dap.ui.widgets').preview()
  --     end)
  --     keymap.set('n', '<Leader>df', function()
  --       local widgets = require('dap.ui.widgets')
  --       widgets.centered_float(widgets.frames)
  --     end)
  --     keymap.set('n', '<Leader>ds', function()
  --       local widgets = require('dap.ui.widgets')
  --       widgets.centered_float(widgets.scopes)
  --     end)
  --     -- ================================ 断点快捷键配置 =========================


  --     -- ======================= dapui =====================
  --     local dapui = require('dapui')
  --     dapui.setup()
  --     -- https://github.com/rcarriga/nvim-dap-ui
  --     -- 显示断点变量作用域栈信息
  --     keymap.set('n', '<leader>ds', function()
  --       dapui.toggle()
  --     end)

  --     -- 运行端点后自动调用打开 dapui 界面
  --     dap.listeners.after.event_initialized["dapui_config"] = function()
  --       dapui.open()
  --     end
  --     dap.listeners.before.event_terminated["dapui_config"] = function()
  --       dapui.close()
  --     end
  --     dap.listeners.before.event_exited["dapui_config"] = function()
  --       dapui.close()
  --     end
  --     -- ======================= dapui =====================
  --   end
  -- },
  -- {
  --   event = { "BufReadPost", "BufNewFile" },
  --   "mfussenegger/nvim-dap",
  --   dependencies = {
  --     -- 系统安装 lldb 工具
  --     --
  --     -- debugger
  --     --
  --     -- 末行模式运行 RustDebuggables 依赖 rust-tools 这里没有用到, 所以不用 "simrat39/rust-tools.nvim",  --
  --     -- 打断点  DapToggleBreakpoint
  --     -- 一行一行执行 DapStepOver
  --     --
  --     "rcarriga/nvim-dap-ui",
  --     -- 变量信息变化所见即所得 -- 不是必须的
  --     "theHamsta/nvim-dap-virtual-text",

  --     -- 好看ui提示 -- 不是必须的
  --     "nvim-telescope/telescope-dap.nvim",
  --   },
  --   config = function()
  --     local dap = require('dap')
  --     require("nvim-dap-virtual-text").setup {}

  --     -- ============================ python 断点配置 =============================
  --     dap.adapters.python = function(cb, config)
  --       if config.request == 'attach' then
  --         ---@diagnostic disable-next-line: undefined-field
  --         local port = (config.connect or config).port
  --         ---@diagnostic disable-next-line: undefined-field
  --         local host = (config.connect or config).host or '127.0.0.1'
  --         cb({
  --           type = 'server',
  --           port = assert(port, '`connect.port` is required for a python `attach` configuration'),
  --           host = host,
  --           options = {
  --             source_filetype = 'python',
  --           },
  --         })
  --       else
  --         cb({
  --           type = 'executable',
  --           -- command = 'path/to/virtualenvs/debugpy/bin/python',
  --           command = '/usr/bin/python3',
  --           args = { '-m', 'debugpy.adapter' }, -- 需要安装 pip install debugpy
  --           -- 这里的name对应下面configurations中的type
  --           name = "python",
  --           options = {
  --             source_filetype = 'python',
  --           },
  --         })
  --       end
  --     end
  --     dap.configurations.python = {
  --       {
  --         -- The first three options are required by nvim-dap
  --         type = 'python', -- the type here established the link to the adapter definition: `dap.adapters.python`
  --         request = 'launch',
  --         name = "Debugpy Launch Debug",
  --         program = "${file}", -- This configuration will launch the current file if used.
  --         pythonPath = function()
  --           local cwd = vim.fn.getcwd()
  --           if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
  --             return cwd .. '/venv/bin/python'
  --           elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
  --             return cwd .. '/.venv/bin/python'
  --           else
  --             return '/usr/bin/python'
  --           end
  --         end,
  --       },
  --     }
  --     -- ============================ python 断点配置 =============================

  --     -- ================ C/C++/Rust (via lldb-vscode) 断点配置 =================
  --     dap.adapters.lldb = {
  --       type = 'executable',
  --       command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
  --       name = 'lldb',                    -- 这里的name对应下面configurations中的type
  --     }

  --     -- 配置 c++
  --     dap.configurations.cpp = {
  --       {
  --         name = 'Cpp Launch Debug',
  --         type = 'lldb',
  --         request = 'launch',
  --         program = function()
  --           -- 需要执行断点的程序路径
  --           return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
  --         end,
  --         cwd = '${workspaceFolder}',
  --         stopOnEntry = false,
  --         args = {},
  --         env = function()
  --           local variables = {}
  --           for k, v in pairs(vim.fn.environ()) do
  --             table.insert(variables, string.format("%s=%s", k, v))
  --           end
  --           return variables
  --         end,
  --         -- 💀
  --         -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
  --         --
  --         --    echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
  --         --
  --         -- Otherwise you might get the following error:
  --         --
  --         --    Error on launch: Failed to attach to the target process
  --         --
  --         -- But you should be aware of the implications:
  --         -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
  --         -- runInTerminal = false,
  --       },
  --     }

  --     -- If you want to use this for Rust and C, add something like this:

  --     -- 配置 c
  --     -- dap.configurations.c = dap.configurations.cpp
  --     dap.configurations.rust = dap.configurations.cpp

  --     -- 配置 rust
  --     dap.configurations.rust = {
  --       {
  --         name = "Rust Launch Debug",
  --         type = "lldb",
  --         request = "launch",
  --         program = function()
  --           -- 执行命令 cargo build
  --           vim.fn.jobstart("cargo build")
  --           return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
  --         end,
  --         cwd = "${workspaceFolder}",
  --         stopOnEntry = false,
  --         -- args = {},
  --         -- 如果需要一些参数
  --         args = function()
  --           -- 同样的进行命令行参数指定
  --           local inputstr = vim.fn.input("CommandLine Args:", "")
  --           local params = {}
  --           for param in string.gmatch(inputstr, "[^%s]+") do
  --             table.insert(params, param)
  --           end
  --           return params
  --         end,
  --         showDisassembly = "never",
  --         initCommands = function()
  --           -- Find out where to look for the pretty printer Python module
  --           local rustc_sysroot = vim.fn.trim(vim.fn.system("rustc --print sysroot"))

  --           local script_import = 'command script import "'
  --               .. rustc_sysroot
  --               .. '/lib/rustlib/etc/lldb_lookup.py"'
  --           local commands_file = rustc_sysroot .. "/lib/rustlib/etc/lldb_commands"

  --           local commands = {}
  --           local file = io.open(commands_file, "r")
  --           if file then
  --             for line in file:lines() do
  --               table.insert(commands, line)
  --             end
  --             file:close()
  --           end
  --           table.insert(commands, 1, script_import)

  --           return commands
  --         end,
  --       }
  --     }
  --     -- ================ C/C++/Rust (via lldb-vscode) 断点配置 =================


  --     -- ================================ 断点快捷键配置 =========================
  --     local keymap = vim.keymap

  --     -- 断点快捷键设置
  --     -- https://github.com/mfussenegger/nvim-dap/tree/56118cee6af15cb9ddba9d080880949d8eeb0c9f
  --     -- -- 下一步
  --     -- keymap.set('n', '<F5>', function() require('dap').continue() end)
  --     -- -- 单步
  --     -- keymap.set('n', '<F10>', function() require('dap').step_over() end)
  --     -- -- 进入
  --     -- keymap.set('n', '<F11>', function() require('dap').step_into() end)
  --     -- keymap.set('n', '<F12>', function() require('dap').step_out() end)

  --     -- 下一步
  --     -- keymap.set('n', 'dc', function() require('dap').continue() end)
  --     -- telescope 替换 require('dap').continue() 好看一些
  --     keymap.set('n', '<Leader>dc', function() require('telescope').extensions.dap.configurations {} end)
  --     -- require('telescope').extensions.dap.configurations {}
  --     -- require('telescope').extensions.dap.commands {}
  --     -- require('telescope').extensions.dap.list_breakpoints {}
  --     -- require('telescope').extensions.dap.variables {}
  --     -- require('telescope').extensions.dap.frames {}

  --     -- 单步
  --     keymap.set('n', '<Leader>do', function() require('dap').step_over() end)
  --     -- 进入
  --     keymap.set('n', '<Leader>di', function() require('dap').step_into() end)
  --     keymap.set('n', '<Leader>dt', function() require('dap').step_out() end)
  --     -- 设置断点
  --     keymap.set('n', '<Leader>db', function() require('dap').toggle_breakpoint() end)
  --     keymap.set('n', '<Leader>DB', function() require('dap').set_breakpoint() end)
  --     keymap.set('n', '<Leader>lp', function()
  --       require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: '))
  --     end)
  --     keymap.set('n', '<Leader>dr', function() require('dap').repl.open() end)
  --     keymap.set('n', '<Leader>dl', function() require('dap').run_last() end)
  --     keymap.set({ 'n', 'v' }, '<Leader>dh', function()
  --       require('dap.ui.widgets').hover()
  --     end)
  --     keymap.set({ 'n', 'v' }, '<Leader>dp', function()
  --       require('dap.ui.widgets').preview()
  --     end)
  --     keymap.set('n', '<Leader>df', function()
  --       local widgets = require('dap.ui.widgets')
  --       widgets.centered_float(widgets.frames)
  --     end)
  --     keymap.set('n', '<Leader>ds', function()
  --       local widgets = require('dap.ui.widgets')
  --       widgets.centered_float(widgets.scopes)
  --     end)
  --     -- ================================ 断点快捷键配置 =========================


  --     -- ===================================== dapui ==========================
  --     local dapui = require('dapui')
  --     dapui.setup()
  --     -- https://github.com/rcarriga/nvim-dap-ui
  --     -- 显示断点变量作用域栈信息
  --     keymap.set('n', '<leader>ds', function()
  --       dapui.toggle()
  --     end)

  --     -- 运行端点后自动调用打开 dapui 界面
  --     dap.listeners.after.event_initialized["dapui_config"] = function()
  --       dapui.open()
  --     end
  --     dap.listeners.before.event_terminated["dapui_config"] = function()
  --       dapui.close()
  --     end
  --     dap.listeners.before.event_exited["dapui_config"] = function()
  --       dapui.close()
  --     end
  --     -- ===================================== dapui ==========================
  --   end
  -- },
  {
    event = { "BufReadPost", "BufNewFile" },
    "mfussenegger/nvim-dap",
    dependencies = {
      -- 系统安装 lldb 工具
      --
      -- debugger
      --
      -- 末行模式运行 RustDebuggables 依赖 rust-tools 这里没有用到, 所以不用 "simrat39/rust-tools.nvim",  --
      -- 打断点  DapToggleBreakpoint
      -- 一行一行执行 DapStepOver
      --
      "rcarriga/nvim-dap-ui",
      -- 变量信息变化所见即所得 -- 不是必须的
      "theHamsta/nvim-dap-virtual-text",

      -- 好看ui提示 -- 不是必须的
      "nvim-telescope/telescope-dap.nvim",
    },
    config = function()
      local dap = require('dap')
      require("nvim-dap-virtual-text").setup {}

      -- ============================ python 断点配置 =============================
      dap.adapters.python = function(cb, config)
        if config.request == 'attach' then
          ---@diagnostic disable-next-line: undefined-field
          local port = (config.connect or config).port
          ---@diagnostic disable-next-line: undefined-field
          local host = (config.connect or config).host or '127.0.0.1'
          cb({
            type = 'server',
            port = assert(port, '`connect.port` is required for a python `attach` configuration'),
            host = host,
            options = {
              source_filetype = 'python',
            },
          })
        else
          cb({
            type = 'executable',
            -- command = 'path/to/virtualenvs/debugpy/bin/python',
            command = '/usr/bin/python3',
            args = { '-m', 'debugpy.adapter' }, -- 需要安装 pip install debugpy
            -- 这里的name对应下面configurations中的type
            name = "python",
            options = {
              source_filetype = 'python',
            },
          })
        end
      end
      dap.configurations.python = {
        {
          -- The first three options are required by nvim-dap
          type = 'python', -- the type here established the link to the adapter definition: `dap.adapters.python`
          request = 'launch',
          name = "Debugpy Launch Debug",
          program = "${file}", -- This configuration will launch the current file if used.
          pythonPath = function()
            local cwd = vim.fn.getcwd()
            if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
              return cwd .. '/venv/bin/python'
            elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
              return cwd .. '/.venv/bin/python'
            else
              return '/usr/bin/python'
            end
          end,
        },
      }
      -- ============================ python 断点配置 =============================

      -- ================ C/C++/Rust (via lldb-vscode) 断点配置 =================
      dap.adapters.lldb = {
        type = 'executable',
        -- 这里指向lldb-vscode的实际路径  which lldb-vscode
        -- 参考 https://zhuanlan.zhihu.com/p/590908735
        -- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
        -- lldb-vscode lldb-server 提前编译好的路径
        -- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#ccrust-via-lldb-vscode
        command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
        name = 'lldb',                    -- 这里的name对应下面configurations中的type
      }

      -- 配置 c++
      dap.configurations.cpp = {
        {
          name = 'Cpp Launch Debug',
          type = 'lldb',
          request = 'launch',
          program = function()
            -- 需要执行断点的程序路径
            return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
          end,
          cwd = '${workspaceFolder}',
          stopOnEntry = false,
          args = {},
          env = function()
            local variables = {}
            for k, v in pairs(vim.fn.environ()) do
              table.insert(variables, string.format("%s=%s", k, v))
            end
            return variables
          end,
        },
      }

      -- 配置 c
      -- dap.configurations.c = dap.configurations.cpp

      -- 配置 rust
      dap.configurations.rust = dap.configurations.cpp
      dap.configurations.rust = {
        {
          name = "Rust Launch Debug",
          type = "lldb",
          request = "launch",
          -- program = function()
          --   -- 执行命令 cargo build
          --   vim.fn.jobstart("cargo build")
          --   return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
          -- end,
          program = function()
            -- 获取程序打包后的文件, 注意先 cargo run 运行打包一下,否这找不到
            -- vim.notify(target_dir .. "/debug/" .. target_name, vim.log.levels.INFO, {})
            vim.fn.jobstart("cargo build")
            local metadata_json = vim.fn.system "cargo metadata --format-version 1 --no-deps"
            local metadata = vim.fn.json_decode(metadata_json)
            local target_name = metadata.packages[1].targets[1].name
            local target_dir = metadata.target_directory
            return target_dir .. "/debug/" .. target_name
          end,

          cwd = "${workspaceFolder}",
          stopOnEntry = false,
          -- args = {},
          -- 如果需要一些参数
          args = function()
            -- 同样的进行命令行参数指定
            local inputstr = vim.fn.input("CommandLine Args:", "")
            local params = {}
            for param in string.gmatch(inputstr, "[^%s]+") do
              table.insert(params, param)
            end
            return params
          end,
          showDisassembly = "never",
          initCommands = function()
            -- Find out where to look for the pretty printer Python module
            local rustc_sysroot = vim.fn.trim(vim.fn.system("rustc --print sysroot"))

            local script_import = 'command script import "'
                .. rustc_sysroot
                .. '/lib/rustlib/etc/lldb_lookup.py"'
            local commands_file = rustc_sysroot .. "/lib/rustlib/etc/lldb_commands"

            local commands = {}
            local file = io.open(commands_file, "r")
            if file then
              for line in file:lines() do
                table.insert(commands, line)
              end
              file:close()
            end
            table.insert(commands, 1, script_import)

            return commands
          end,
        }
      }
      -- ================ C/C++/Rust (via lldb-vscode) 断点配置 =================


      -- ================================ 断点快捷键配置 =========================
      local keymap = vim.keymap

      -- 查看默认的配置 :help dap-mapping

      -- 断点快捷键设置
      -- https://github.com/mfussenegger/nvim-dap/tree/56118cee6af15cb9ddba9d080880949d8eeb0c9f
      -- -- 下一步
      -- keymap.set('n', '<F5>', function() require('dap').continue() end)
      -- -- 单步
      -- keymap.set('n', '<F10>', function() require('dap').step_over() end)
      -- -- 进入
      -- keymap.set('n', '<F11>', function() require('dap').step_into() end)
      -- keymap.set('n', '<F12>', function() require('dap').step_out() end)

      -- 下一步
      -- keymap.set('n', 'dc', function() require('dap').continue() end)
      -- telescope 替换 require('dap').continue() 好看一些
      keymap.set('n', '<Leader>dc', function() require('telescope').extensions.dap.configurations {} end)
      -- require('telescope').extensions.dap.configurations {}
      -- require('telescope').extensions.dap.commands {}
      -- require('telescope').extensions.dap.list_breakpoints {}
      -- require('telescope').extensions.dap.variables {}
      -- require('telescope').extensions.dap.frames {}

      -- 单步
      keymap.set('n', '<Leader>do', function() require('dap').step_over() end)
      -- 进入
      keymap.set('n', '<Leader>di', function() require('dap').step_into() end)
      keymap.set('n', '<Leader>dt', function() require('dap').step_out() end)
      -- 设置断点
      keymap.set('n', '<Leader>db', function() require('dap').toggle_breakpoint() end)
      keymap.set('n', '<Leader>DB', function() require('dap').set_breakpoint() end)
      keymap.set('n', '<Leader>lp', function()
        require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: '))
      end)
      keymap.set('n', '<Leader>dr', function() require('dap').repl.open() end)
      keymap.set('n', '<Leader>dl', function() require('dap').run_last() end)
      keymap.set({ 'n', 'v' }, '<Leader>dh', function()
        require('dap.ui.widgets').hover()
      end)
      keymap.set({ 'n', 'v' }, '<Leader>dp', function()
        require('dap.ui.widgets').preview()
      end)
      keymap.set('n', '<Leader>df', function()
        local widgets = require('dap.ui.widgets')
        widgets.centered_float(widgets.frames)
      end)
      -- keymap.set('n', '<Leader>ds', function()
      --   local widgets = require('dap.ui.widgets')
      --   widgets.centered_float(widgets.scopes)
      -- end)
      -- ================================ 断点快捷键配置 =========================


      -- ===================================== dapui ==========================
      local dapui = require('dapui')
      dapui.setup()
      -- https://github.com/rcarriga/nvim-dap-ui
      -- 显示断点变量作用域栈信息
      keymap.set('n', '<leader>ds', function()
        dapui.toggle()
      end)

      -- 运行端点后自动调用打开 dapui 界面
      dap.listeners.after.event_initialized["dapui_config"] = function()
        dapui.open()
      end
      dap.listeners.before.event_terminated["dapui_config"] = function()
        dapui.close()
      end
      dap.listeners.before.event_exited["dapui_config"] = function()
        dapui.close()
      end
      -- ===================================== dapui ==========================
    end
  }
}
